package com.nlelpct.manage.enums;

public enum SysOperateTypeEnum {


    INSERT("新增", 200),

    UPDATE("修改", 201),

    DEL("删除", 202),

    EXPORT("导出", 203),

    PRINT("打印", 204);


    private final String name;
    private final Integer index;


    SysOperateTypeEnum(String name, Integer index) {
        this.name = name;
        this.index = index;
    }

    public static String getName(Integer index) {
        for (SysOperateTypeEnum value : SysOperateTypeEnum.values()) {
            if (value.getIndex().equals(index)) {
                return value.name;
            }
        }
        return null;
    }

    public static Integer getIndex(String name) {
        for (SysOperateTypeEnum value : SysOperateTypeEnum.values()) {
            if (value.getName().equals(name)) {
                return value.index;
            }
        }
        return null;
    }

    public Integer getIndex() {
        return index;
    }

    public String getName() {
        return name;
    }

    }
